/* 작성자 : Jint
 * 작성일 : 140424
 * 내용 : 
 */

package stream;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.Date;
	
public class Ex_ObjectOutputStream {
	
	public static void main(String[] args) {
		ObjectOutputStream dos = null;
		try{
			dos = new ObjectOutputStream(new FileOutputStream("test.ser"));
			dos.writeObject(new String("Hello"));
			dos.writeObject(new Integer(100));
			dos.writeObject(new Date());
			dos.close();
			System.out.println("객체를 파일로 저장 성공!");
			
		}catch(FileNotFoundException fe){
			System.out.println(fe.getMessage());
			
		}catch(IOException ie){
			System.out.println(ie.getMessage());
		}
		
	}
	
}
